package com.sxt.obj;

import com.sxt.GameWin;
import com.sxt.utils.GameUtils;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class FoodObj extends GameObj {
    Random r = new Random();

    public FoodObj() {
        super();
    }

    public FoodObj(Image img, int x, int y, GameWin frame) {
        super(img, x, y, frame);
    }

    // 获取多个食物
    public List<FoodObj> getMultipleFood(int count) {
        List<FoodObj> foodList = new ArrayList<>();
        for (int i = 0; i < count; i++) {
            foodList.add(new FoodObj(GameUtils.foodImg, r.nextInt(20) * 30, (r.nextInt(19) + 1) * 30, this.frame));
        }
        return foodList;
    }

    @Override
    public void paintSelf(Graphics g) {
        super.paintSelf(g);
    }
}
